package com.example.util;

import cn.hutool.core.util.StrUtil;
import org.apache.commons.codec.language.bm.Lang;
import org.springframework.util.StringUtils;

import java.util.ArrayList;

/**
 * @author leiliang
 * @version 1.0
 * @Description
 * @date 2021/6/9 11:28
 */
public class TestUtils {

    /**
     * 校验多个参数是否为空
     * @param objects
     * @return
     */
    public static boolean isNullValuesExist(Object... objects) {
        for (Object object : objects) {
            if (StringUtils.isEmpty(object)) {
                return true;
            }
        }
        return false;
    }


    public static void main(String[] args) {
        Long updateTime = 1627550824388L;
        if (StrUtil.isNotEmpty(updateTime.toString())){
            String time = String.valueOf(updateTime / 1000);
            if (StrUtil.isNotBlank(time)){
                String s = DateUtil.timeStamp2Date(time, "yyyy-MM-dd");
                if (StrUtil.isNotBlank(s)){
                    System.out.println("格式化后的日期" + s);
                 }else {
                    System.out.println("日期为空");
                 }
            }
        }


      /*  Long  a  = 0L;
        long l = a.longValue();
        if (l == 0){
            System.out.println("相等");
        }else {
            System.out.println("不等");
        }*/
     /*   double value = 23.0;
        int num =  new Double(value).intValue();
        System.out.println(num);*/
       // boolean nullValuesExist = isNullValuesExist(new String[]{"1", ""}, "", new ArrayList());
      /*  long  ll = -1;
        if (ll == -1){
            System.out.println("111");
        }else {
            System.out.println("222");
        }*/
        //System.out.println(nullValuesExist);
    }
}
